package second;
import org.springframework.context.ApplicationContext;
import service.IOrderService;
import vo.Order;
import vo.Orderitem;
import service.IOrderItemService;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class testOrder {
	ApplicationContext ac;
	IOrderService orderService;
	IOrderItemService orderItemService;
	public testOrder(){
		ac=new ClassPathXmlApplicationContext("ApplicationContext.xml");
		orderService=(IOrderService)ac.getBean("orderService");
		orderItemService=(IOrderItemService)ac.getBean("orderItemService");
	}
	public static void main(String[] args){
	testOrder to=new testOrder();
	Order order=to.orderService.creatOrder(1, "numberhh",15.5);
	System.out.println(order.getOrderId());
	Orderitem oi=to.orderItemService.createOrderItem(1, 2, 2);
	System.out.println(oi.getOrderItemId());
	}
}
